package com.chen.controller;


import com.chen.base.ResponseResult;
import com.chen.service.LoginService;
import com.chen.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 *  登录接口
 */
@RestController
@RequestMapping("security")
public class LoginController {

    @Autowired
    LoginService loginService;

    /**
     * 用户登录
     * @param userVo
     * @return
     */
    @PostMapping("login")
    public ResponseResult<UserVo> login(@RequestBody UserVo userVo){
        return ResponseResult.success(loginService.login(userVo));
    }
}
